//
//  SupermarketViewController.m
//  AffectionBee
//
//  Created by 李通 on 16/8/18.
//  Copyright © 2016年 chivalrous. All rights reserved.
//

#import "SupermarketViewController.h"
#import "TapTableView.h"
#import "ProductTableView.h"
#import "TabModel.h"
#import "ProductModel.h"
#define SCREENSIZE [UIScreen mainScreen].bounds.size
@interface SupermarketViewController ()
@property(nonatomic,weak)TapTableView*tap;
@property(nonatomic,weak)ProductTableView*product;
@property(nonatomic,copy)NSArray<TabModel*>*modelList;

@end

@implementation SupermarketViewController
- (void)viewDidLoad {
    [super viewDidLoad];
//    [TabModel modelListWithUrlStr:@"http://iosapi.itcast.cn/loveBeen/supermarket.json.php" parameters:@{@"call":@(5)} SuccessBlock:^(NSArray<TabModel *> *modelList) {
//        self.modelList = modelList;
//        //刷新界面
//        [self loadViewIfNeeded];
//    } failure:^(NSError *error) {
//        NSLog(@"%@",error);
//    }];
    [self setupUI];
}
-(void)setupUI{
    TapTableView * tap = [[TapTableView alloc]initWithFrame:CGRectMake(0, 0, SCREENSIZE.width*0.25,SCREENSIZE.height)];
    self.tap = tap;
    NSArray *tapArray = @[@(1),@(2),@(3),@(4)];
    tap.array = tapArray;
    ProductTableView* product = [[ProductTableView alloc]initWithFrame:CGRectMake(SCREENSIZE.width*0.25, 64, SCREENSIZE.width*0.75,SCREENSIZE.height)];
    self.product = product;
    NSArray<NSArray*>*productArray = @[tapArray,tapArray,tapArray,tapArray];
    product.array = productArray;
    [self.view addSubview:tap];
    [self.view addSubview:product];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
